package com.carter.springframework.beans.factory.support;

import cn.hutool.core.lang.Assert;
import com.carter.springframework.beans.BeanMetadataElement;
import com.sun.istack.internal.Nullable;

public abstract class MethodOverride implements BeanMetadataElement {
    private final String methodName;

    private boolean overloaded = true;

    @Nullable
    private Object source;

    protected MethodOverride(String methodName) {
        Assert.notNull(methodName, "Method name must not be null");
        this.methodName = methodName;
    }

    public String getMethodName() {
        return methodName;
    }

    public boolean isOverloaded() {
        return overloaded;
    }

    public void setOverloaded(boolean overloaded) {
        this.overloaded = overloaded;
    }

    @Override
    public Object getSource() {
        return source;
    }

    public void setSource(Object source) {
        this.source = source;
    }
}
